import { useDispatch, useSelector } from "react-redux";

function Count() {
    const count = useSelector((state) => state.count);
    const dispatch = useDispatch();
    return (
        <div>
            <p>count: {count}</p>
            <button
                onClick={() => {
                    dispatch({
                        type: "count_add",
                    });
                }}
            >
                count递增
            </button>
        </div>
    );
}

export default Count;
